$(".registr").click(function () {
    const userNameVal = $(".userName input").val(),
        passwordVal = $(".password input").val();
    if (!userNameVal) return alert("账号不能为空");
    if (!passwordVal) return alert("密码不能为空");

    $.ajax({
        type: "POST",
        url: "http://114.115.133.220:2023/api/register",
        data: {
            userName: userNameVal,
            password:passwordVal
        },
        success: function (res) {
            if (res.code === "10000") {
                alert("添加成功");
                location.href = "http://114.115.133.220/account/src/login/login.html";
            }
            else {
                alert(res.message);
            }
        }
    })
})